package com.ecp.commons.filter;

public class WebContextFactory {
	public WebContextFactory() {
	}

	private static ThreadLocal<WebContext>	webContext	= new ThreadLocal<WebContext>();

	public static void setWebContext(WebContext ctx) {
		webContext.set(ctx);
	}

	public static WebContext getWebContext() {
		WebContext ctx = (WebContext) webContext.get();
		if (ctx == null) {
			ctx = new WebContext();
			setWebContext(ctx);
		}
		return (WebContext) webContext.get();
	}

}
